<script>
import { h } from 'vue'
export default {
  name: 'XtxBread',
  props: {
    icon: {
      type: String,
      default: 'icon-angle-right'
    }
  },
  render () {
    // console.log(this.$slots.default())
    const slots = this.$slots.default()
    const arr = []
    slots.forEach((item, index) => {
      arr.push(item)
      if (index < slots.length - 1) {
        arr.push(h('i', { className: `iconfont ${this.icon}` }))
      }
    })
    return h('div', { className: 'xtx-bread' }, arr)
  }
}
</script>

<style lang="less" scoped>
.xtx-bread {
  display: flex;
  padding: 25px 10px;
  i {
    font-size: 12px;
    margin-left: 5px;
    margin-right: 5px;
    line-height: 22px;
  }
}
</style>
